﻿using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Hasiu.Web
{
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            log4net.Config.XmlConfigurator.Configure();
            AreaRegistration.RegisterAllAreas();
            var routes = RouteTable.Routes;
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(Guid.NewGuid().ToString(), "", new { controller = "Home", action = "Index" });

            routes.MapRoute(Guid.NewGuid().ToString(), "tools/editor.aspx", new { controller = "EditorTools", action = "Index" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/editor/ajax.aspx", new { controller = "EditorTools", action = "Ajax" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/editor/del.aspx", new { controller = "EditorTools", action = "Del" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/upload/file.aspx", new { controller = "UploadTools", action = "UploadFile" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/upload/img.aspx", new { controller = "UploadTools", action = "UploadImg" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/cutimg.aspx", new { controller = "CutimgTools", action = "Index" });
            routes.MapRoute(Guid.NewGuid().ToString(), "tools/yzm.aspx", new { controller = "YzmTools", action = "Index" });

            routes.MapRoute(Guid.NewGuid().ToString(), "admin.aspx", new { controller = "HomeAdmin", action = "Index" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/login.aspx", new { controller = "HomeAdmin", action = "Login" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/logout.aspx", new { controller = "HomeAdmin", action = "LogOut" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/updatepassword.aspx", new { controller = "HomeAdmin", action = "UpdatePassword" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/textshow/{id}.aspx", new { controller = "TextShowAdmin", action = "Save" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/news/save.aspx", new { controller = "NewsAdmin", action = "Save" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/news/del.aspx", new { controller = "NewsAdmin", action = "Del" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/news/list.aspx", new { controller = "NewsAdmin", action = "List" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/slide.aspx", new { controller = "SlideAdmin", action = "Index" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/slide/del.aspx", new { controller = "SlideAdmin", action = "Del" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/type.aspx", new { controller = "ProductAdmin", action = "Type" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/type/del.aspx", new { controller = "ProductAdmin", action = "DelType" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/save.aspx", new { controller = "ProductAdmin", action = "Save" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/del.aspx", new { controller = "ProductAdmin", action = "Del" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/list.aspx", new { controller = "ProductAdmin", action = "List" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/img.aspx", new { controller = "ProductAdmin", action = "Img" });
            routes.MapRoute(Guid.NewGuid().ToString(), "admin/product/img/del.aspx", new { controller = "ProductAdmin", action = "DelImg" });
        }
    }
}